package day02;

import java.util.Arrays;
import java.util.Comparator;

/**
 * Created by Administrator on 2023/6/30 0030.
 */
public class SortDemo {

    public static void main(String[] args) {
        int[] a = new int[]{1, 3, 5, 7, 9, 2, 4, 6, 8, 0};
        Arrays.sort(a);
        System.out.println(Arrays.toString(a));
        String[] words = "to know everything is to know nothing".split(" ");
        Arrays.sort(words, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return o1.length() - o2.length();
            }
        });//inline
        System.out.println(Arrays.asList(words));
    }
}
